#ifndef CUDA_COM_HEADER
#define CUDA_COM_HEADER

#include <cuda.h>
#include <cuda_runtime.h>
#include <cstdlib>
#include <cstdio>


// Calls wrapped with DBG_CUDA_CALL will not be checked for errors if DO_DEBUG is set
#define DO_DEBUG

#ifdef DO_DEBUG

#define DBG_CUDA_CALL(FUNC, STR) { \
	cudaError_t err = FUNC; \
	if (err != CUDA_SUCCESS){ fprintf(stderr, "%s -- API Error Desc: %s\n", STR, cudaGetErrorString(err)); } }

#define DBG_CUDA_CHECK_ERRORS DBG_CUDA_CALL(cudaGetLastError(), "Checking last error")
	  
#else
#define DBG_CUDA_CALL(FUNC, STR) { FUNC; } 
#define DBG_CUDA_CHECK_ERRORS {}
#endif

#endif

